<template>
  <el-config-provider :locale="locale" :size="size">
    <router-view />
  </el-config-provider>
</template>

<script setup>
import { computed } from 'vue'
import zhCN from 'element-plus/es/locale/lang/zh-cn'
import enUS from 'element-plus/es/locale/lang/en'
import useAppStore from '@/store/modules/app'

// 获取全局语言、组件大小配置
const appStore = useAppStore()

const locale = computed(() => {
  return appStore.language === 'zh_CN' ? zhCN : enUS
})
const size = computed(() => appStore.size)
</script>
